<?php
namespace app\index\model;

use app\index\service\LunwenTransactionRecordServer;
use think\Model;

class LunwenTransactionRecordModel extends model{

    protected $name = 'lunwen_transaction_record';
    protected $pk = 'id';
    
    const TRANSACTION_TYPE_RECHARGE = 1;
    const TRANSACTION_TYPE_DEDUCT = 2;

    const TRANSACTION_TYPE_ARR = [
        self::TRANSACTION_TYPE_RECHARGE => '充值',
        self::TRANSACTION_TYPE_DEDUCT => '消费',
    ];



    public $append = ['transaction_type_str'];


    public function getTransactionTypeStrAttr(){
        return self::TRANSACTION_TYPE_ARR[$this->transaction_type];

    }

}   